# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-fire
pkgver=0.5.0
pkgrel=0
pkgdesc="A library for automatically generating command line interfaces"
url="https://github.com/google/python-fire"
arch="noarch"
license="Apache-2.0"
depends="
	py3-six
	py3-termcolor
	python3
	"
makedepends="
	py3-gpep517
	py3-installer
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest-asyncio
	py3-hypothesis
	py3-mock
	py3-pytest
	"
source="https://pypi.python.org/packages/source/f/fire/fire-$pkgver.tar.gz
	0001-Fix-Python3.11-tests.patch
	"
builddir="$srcdir/fire-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl

	case "$CARCH" in
		armv7) .testenv/bin/python3 -m unittest discover -k 'not test_fuzz_parse' ;;
		*) .testenv/bin/python3 -m unittest discover ;;
	esac
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
645a9973e27a42aab58b0c045c5ceaa087c9f27b854d870addc4dbf697a0d6f633bf7754a6c07761a965433fe6f1a701b62408d17b590bb5233d99d7fbab0ecf  fire-0.5.0.tar.gz
9fcd97304a7c616879bf8d55cd77f5f54076e6e14c50c86bbe888b55a54b169dd5f984a30969edf1fe0a62a32fadce767d3597b684d37984c868a0bfcb01426c  0001-Fix-Python3.11-tests.patch
"
